<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<title>testBasic</title>
</head>
<body>
<script type="text/javascript" src="framework7.js"></script>
<script type="text/javascript">
var $$ = Dom7;
$$.ajax({
    url:"http://localhost:8080",
    method:"GET",
	data:{},
	dataType:'json',
	xhrFields: {
        withCredentials: true
    },
    headers: {
        'Authorization': 'Basic ' + btoa('admin:C1sco12#')
    },
	timeout:4000,
	success: function (ajaxresult) {
		var cX = ajaxresult[0].mapCoordinate.x;
		var cY = ajaxresult[0].mapCoordinate.y;
		alert('返回成功<br>mapCoordinate.x='+cX+'<br>mapCoordinate.y='+cY);
	},
	error:function(xhr, status){
		alert('请求失败status:'+status);
	},
	statusCode:{
		200: function (xhr) {
		      alert('code:200，请求成功');
		    },
	    401: function (xhr) {
		      alert('code:401，请求要求身份验证');
		    },
	    403: function (xhr) {
		      alert('code:403，服务器拒绝请求');
		    },
		404: function (xhr) {
		      alert('code:404，页面未找到');
		    },
	    408: function (xhr) {
		      alert('code:401，请求超时');
		    },
	    500: function (xhr) {
		      alert('code:500，服务器内部错误');
		    }
	}
});
</script>
</body>
</html>